package com.lrkj.back.service.impl;

import java.util.List;
import java.util.Map;

import com.lrkj.back.mapper.ZsSoftMapper;
import com.lrkj.back.entity.ZsSoft;
import com.lrkj.back.service.ZsSoftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.cbons.mamisay.parent.db.api.DBInterface;
import cn.com.cbons.mamisay.parent.exception.DBException;
import cn.com.cbons.mamisay.parent.service.base.ParentServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Transactional
@Service("zsSoftService")
public class ZsSoftServiceImpl extends ParentServiceImpl<ZsSoft> implements ZsSoftService {
    @Autowired
    private ZsSoftMapper zsSoftMapper;

    @Override
    protected DBInterface<ZsSoft> getDao() throws DBException {
        return zsSoftMapper;
    }

    @Override
    public List<ZsSoft> queryZsSoftList(Map<String, Object> map) throws DBException {
        return zsSoftMapper.findAllZsSoftList(map);
    }

    @Override
    public PageInfo<ZsSoft> findAllZsSoftList(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<ZsSoft> list = zsSoftMapper.findAllZsSoftList(map);
        PageInfo<ZsSoft> zsSoft = new PageInfo<ZsSoft>(list);
        return zsSoft;
    }

    @Override
    public List<ZsSoft> findZsSoftListByType() throws DBException {
        return zsSoftMapper.findZsSoftListByType();
    }

    @Override
    public List<ZsSoft> findSoftByEquipId(Map<String, Object> map) throws DBException {
        return zsSoftMapper.findSoftByEquipId(map);
    }

    @Override
    public ZsSoft findOne(Map<String, Object> map) throws DBException {
        return zsSoftMapper.findOne(map);
    }

}
